Babylonian-style Programming - Design and Implementation of an Integration of Live Examples Into General-purpose Source Code (2019)
https://scrapbox.io/files/6098f0bef032f6001d87ffc3.png
そもそも Live Programming Environment は、 onSave とかで与えて置いた example を実行して、ユーザーに即座にフィードバックを与えるもの、unit-test とは違うんじゃ
unit tests aim to test code for conformance, whereas live programming with examples focuses on visualization techniques to make the described dynamic behavior more concrete
まとめ
existing Example based live programming system をサーベイして、いいところと改善すべきところをまとめたよ
いいとこ取りの最強 live programming 環境を作ったぜ (babylonian style programming)
既存のシステムよりも、複雑なプログラムがかける開発環境だぜ
それぞれのlive programming環境で重要な点について、3つのプログラミングシナリオにそいつつ分析したよ (客観性に欠ける)
response time の計測もしたよ
こういうツールの有用性の検証ってどうするのがいいんですかね?
hr.icon
過去のツールのサーベイ
two-pane のプログラミング環境、実行時情報を左のペインに表示して~みたいなインタラクティブなコード開発環境だよ
https://scrapbox.io/files/6098e0c46a0c270022114927.png
result とか should とかが動的にupdateされる。これによりexampleをプログラム内に埋め込むことができるように (probe)
しかし doctest とそんなに変わらない(実行時情報を表示する場所がない)のが問題
Live Literals と同様にコードの中にコメントでexampleを埋め込む
https://scrapbox.io/files/6098e1f97ff686001c80d48e.png
しかし live literals とは違って example-centric programming みたく右隣の pnae に実行時情報を表示
implicit exmple
文字情報だけじゃなくて、画像情報も表示できてすごいぞー
implicit exmple で教育用、実行時の変数のトレースをどんどん表示していく
https://scrapbox.io/files/6098e78261a9e2001e8daf05.png
exampleを与えラズ単に実行するだけ
general purpose な IDE なのが良いところ
これが最強の live programming system や
Feedback on Runtime State
Feedback granularity
実行時情報も欲しかったりいらなかったり(つまりどういうこと)
State over time
transition of runtime state should become visible (???)
State over modules
別の関数やモジュールを使っている場合も実行時情報が取れるべき
Arbitrary objects
複雑なデータ構造もいい感じに表示できるべき
Domain-specific feedback
ドメインスペシフィックな複雑なデータ構造をいい感じに表示できてほしい (例えばSVGデータをXMLのまま表示してもしょうがないんじゃ)
Associating Example with code
Live literal や Shiranui がやっているように example はコード内に組み込めるようになっているのが便利
Multiple examples for one part of the application
複数の example がコードに付与できる
Reusing parts of examples
example を 関数みたいに他のところから参照できるといい
Determining Relevant Sections of Code
ユーザーが関心のあるタスクに関連するプログラム部分だけをユーザーに表示したい
Control flow ある example のもとではどこの control flow が実行されるか
Runtime State 実行時のある点の情報はプログラム中のどこからきた情報か
Program output 標準出力やファイル作成などのside effectが起きたときにそれがどこの行で起こっているのかしりたい
Specifying Context
実行時の context 情報 (class に与える変数やグローバル変数など?)を指定できてほしい
Keeping Track of Assumptions
テストケースのように最終的にこうなってほしいというassertionを設定したら、それがある入力でどうかをトラックしてほしい
Navigating the Trace
trace 情報をぽちぽちでナビゲートできてほしい
UI Design Challenges
Should the system display all information in one single pane, or split source code and examples into two different panes?
If a single-pane layout is chosen, should example-related information be integrated into the source code as actual statements (see Live Literals), or should it be displayed on top by the IDE (see Light Table)?
hr.icon
どんなもの?
https://scrapbox.io/files/6098f0bef032f6001d87ffc3.png
画面に出てくるwidgetをannotationsと呼ぶ。
これが最強の live programming system や
Feedback on Runtime State
実行時情報はない! 不要なこともある(それはそうだが...)
https://scrapbox.io/files/6098f45e26b4370022058831.png
複数回数例が実行された場合は | で区切って実行結果を表示
複雑なデータ構造はJSONっぽいやつで表示
UI Design
In order to tightly integrate behavioral information into abstract source code, we have chosen a single-pane layout
Live literals と違って、プロログラム内に example を埋め込むわけではない
3.3 Associating Examples with Code
For Reusing parts of examples, クラスコンストラクタに与えるパラメータ一覧に名前をつけて管理し、それを参照できる
https://scrapbox.io/files/60990c163d5bd3001c1fe66e.png
また別のタブ?でスクリプトを書いてなんかのinstanceを作るユーティリティメソッドもかける
スクリプト内のすでに定義されているインスタンスをexampleとしてリンクすることも可能
Determining Relevant Sections of Code
code example を与えたときに、実行されないパスはfade-out
Specify context
pre/post script を書いて unit test の teardown とかみたいに前処理できる
Navigating the trace
slider を動かして trace 情報を navigate できる (具体例クレメンス)
hr.icon
先行研究と比べてどこがすごい?
これまでの live-programming tool は complex application に対して使うのは難しかった。なぜなら complex application は component 同士の依存が多かったり、特定の環境でしか動かない場合があったりするから。この研究ではうまいこと live example programming system を multi module の環境でも動作するように実装したり、既存システムをsurvey
既存研究をサーベイして、結局どういうシステムが live programming system に求められているのかをまとめ、それらの requirements を満たすシステムを作ったよ
hr.icon
技術や手法のキモはどこ?
existing Example based live programming system をサーベイして、いいところと改善すべきところをまとめたよ
いいとこ取りの最強 live programming 環境を作ったぜ
Web 上で動くぜ
hr.icon
どうやって有効だと検証した?
3つのプログラミングシナリオに対して、他のツールとの比較を(主観的に)行なっている
(empirical であっても) 定量的な検証は特にない
response time の計測はある
hr.icon
議論はある?
hr.icon
次に読むべき論文は?
A fundamental cognitive challenge in programming is the gap between a program’s code and its behavior